package com.als.healthymananger.entity;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * <p>
 * 
 * </p>
 *
 * @author aion
 * @since 2021-07-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "archives")
@Schema(name = "archive", description = "档案")
public class Archive implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "档案号")
    @TableId(value = "id", type = IdType.INPUT)
    @Size(min = 14, max = 14, message = "档案号长度为14")
    @NotNull
    private String id;

    /**
     * 账号
     */
    @NotNull
    @Schema(description = "用户名")
    private String username;

    /**
     * 姓名
     */
    @NotNull
    @NotBlank
    @Schema(description = "姓名")
    private String name;

    /**
     * 性别
     */
    @Pattern(regexp = "[男|女]{1}", message = "性别只能是男或女")
    @NotNull
    @Schema(description = "性别")
    private String sex;

    /**
     * 身份证号
     */
    @Size(min = 18, max = 18, message = "身份证号长度为18位")
    @NotNull
    private String identity;

    /**
     * 手机号
     */
    @Size(min = 11, max = 11, message = "手机号长度为11位")
    @NotNull
    private String phone;

    /**
     * 民族
     */
    @NotNull
    @NotBlank
    @Schema(description = "民族")
    private String nation;

    /**
     * 出生日期，由身份证号推断
     */
    private LocalDate birthday;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 患者的婚姻情况
     */
    @Schema(description = "婚姻情况")
    private String marry;

    /**
     * 职业
     */
    @Schema(description = "职业")
    private String job;

    /**
     * 文凭
     */
    @Schema(description = "文凭")
    private String diploma;

    @Schema(description = "人群分类")
    private String type;

    /**
     * 分配给患者的健康管理师账号
     */
    @Schema(description = "健康管理师用户名")
    private String masterUsername;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 身高
     */
    @Schema(description = "身高")
    private Float tall;

    /**
     * 体重
     */
    @Schema(description = "体重")
    private Float weight;

    /**
     * 舒张压,单位mmHg
     */
    @Schema(description = "舒张压,单位mmHg")
    private Float diastolicPressure;

    /**
     * 收缩压，单位mmHg
     */
    @Schema(description = "收缩压，单位mmHg")
    private Float systolicPressure;

    /**
     * 呼吸频次，次/分
     */
    @Schema(description = "呼吸频次，次/分")
    private Integer respiratoryFrequency;

    /**
     * 体温，摄氏度
     */
    @Schema(description = "体温，摄氏度")
    private Float temperature;

    /**
     * 腰围，厘米
     */
    @Schema(description = "腰围，厘米")
    private Float waistline;

    /**
     * 臀围，厘米
     */
    @Schema(description = "臀围，厘米")
    private Float hipline;

    /**
     * 身体质量指数
     */
    @Schema(description = "身体质量指数")
    private Float bmi;

    /**
     * 血氧饱和度，%
     */
    @Schema(description = "血氧饱和度，%")
    private Float oxygenSaturationOfBlood;

    /**
     * 病史
     */
    @Schema(description = "病史")
    private String pastHistory;

    /**
     * 家族史
     */
    @Schema(description = "家族史")
    private String familyHistory;

    /**
     * 过敏史
     */
    @Schema(description = "过敏史")
    private String allergicHistory;

    /**
     * 慢性病
     */
    @Schema(description = "慢性病")
    private String chronicDisease;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


}
